from numpy import *
import pylab as p
import matplotlib.axes3d as p3

# u and v are parametric variables.
theta=r_[0:2*pi:50j]
phi=r_[0:pi:50j]
r=r_[0:1:50j]

# x, y, and z are the coordinates of the points for plotting
# each is arranged in a 100x100 array
x=outer(cos(theta),sin(phi))
y=outer(sin(theta),sin(phi))
#z=10*outer(r,r)
z=outer(cos(6*theta),exp(-((r-0.25)**2)/0.01))
fig=p.figure()
ax = p3.Axes3D(fig)
#surf = ax.plot_surface(x,y,z)
ax.contour3D(x,y,z,)
#ax.plot_wireframe(x,y,z)
#surf.set_array(linspace(0,1.0,len(phi)))
ax.set_zlim(-2,2)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
ax.set_xticks([0])
ax.w_yaxis.set_ticks(())
ax.w_xaxis.set_ticks(())
ax.w_zaxis.set_ticks(())
p.show()
